package part1.api.part1.api.io.mytest;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;

public class BISDemo {
    public static void main(String[] args) {
        try (
                FileInputStream fis = new FileInputStream("下载.jpg");
                BufferedInputStream bis = new BufferedInputStream(fis);
                FileOutputStream fos = new FileOutputStream("下载1.jpg");
                BufferedOutputStream bos = new BufferedOutputStream(fos);
        ) {
            int d;
            while ((d=bis.read()) != -1){
                System.out.println(d);
                bos.write(d);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println("复制完毕");
    }

}
